define(function () {
    return function (res, goodsMsg, ele) {
        let str = "";
        res.forEach(val1 => {
            goodsMsg.forEach(val2 => {
                if (val1.id === val2.id) {
                    str += `<div class="goods-items" index="${val2.id}">
                                <div class="goods-allcheck single-area">
                                    <input name="goods" class="checks" value="1630836954076" data-price="298" data-num="1" type="checkbox" ${val2.flag ? 'checked' : ''}>
                                </div>
                                <div class="goods-name single-area">
                                    <img src="${val1.img}" class="goods-image">
                                    &nbsp;&nbsp;
                                    <p class="goods-des">${val1.name}</p>
                                </div>
                                <div class="goods-entry single-area">

                                    <p class="text-light"><input type="number" strs="${val2.id}" pricess="${val1.price}" min="1" value="${val2.num}" style="width:50px;text-align:center" class="setNum"  onchange = "myFunction(this.getAttribute('strs'),this.getAttribute('pricess'),this.value)">
                                    </p>
                                </div>
                                <div class="goods-entry single-area">
                                    <p class="redfont">￥${val1.price}</p>
                                </div>
                                <div class="goods-entry single-area">
                                    <p >￥<span id="${val2.id}">${val1.price * val2.num} </span></p>
                                </div>
                                <div class="goods-entry single-area cursorponiter" onclick="deleteGoods('1630836954076')">
                                    <img src="./images/sc.png" alt="" class="del">
                                </div>
                            </div>`
                }
            })
        })
        ele.html(str);
    }
})
